
/**
 * Title:        <p>
 * Description:  <p>
 * Copyright:    Copyright (c) <p>
 * Company:      <p>
 * @author
 * @version 1.0
 */
package com.klangner.go.app;

import java.awt.BorderLayout;
import java.awt.Label;
import java.awt.Panel;
import java.awt.TextField;

public class SimpleSettingsFrame extends GeneralOKCancel {

    Label label         = null;
    TextField textField = null;
    Panel panel         = null;

    public SimpleSettingsFrame( int maxDepth ) {
        super();

        f_MaxDepthSearch = maxDepth;

        label = new Label();
        textField = new TextField( String.valueOf( maxDepth ) );
        panel = new Panel();

        this.add(panel, BorderLayout.CENTER);

        label.setText("Maximum Search Depth:");

        panel.add(label);
        panel.add(textField);

        loadData();
    }

    protected void saveChanges() {
        f_MaxDepthSearch = new Integer( textField.getText() ).intValue();
    }

    protected void loadData() {
        textField.setText( String.valueOf ( f_MaxDepthSearch ) );
    }

    int getMaxDepth() {
        //return f_MaxDepthSearch;
        return new Integer( textField.getText() ).intValue();
    }

    private int f_MaxDepthSearch = 0;
}